package org.jmetrix.samples.application;

/**
 * @author Konstantin Kuzmin
 * @version $Revision$
 * @since 21.10.11
 */
public class OrderManager {
    public void processOrder(Order order) throws Exception {
        saveOrder(order);
        createInvoice(order);
    }

    protected void saveOrder(Order order) throws Exception {
        Thread.sleep(order.millisecondsToProcess * 10);
    }

    protected void createInvoice(Order order) throws Exception {
        Thread.sleep(order.millisecondsToProcess);
    }

    public void sendInvoice(long sleepMilliseconds) throws Exception {
        Thread.sleep(sleepMilliseconds);
    }

}
